#!/usr/bin/python
from datetime import datetime

class Logger:

	def __init__(self,logfolder,debug=False):
		self.logfolder 	= logfolder
		self.debug	= debug

	def setVerbose(self):
		self.debug      = True

	def now(self):
		now = datetime.now()
		return now.strftime('%Y-%m-%d %H:%M:%S')

	def _log(self , file , str):
		f = open("%s/%s" % (self.logfolder , file ) , "a")
		f.write("%s\t%s\n" % (self.now() , str))
		if self.debug : print "%s\t%s\n" % (self.now() , str)
		f.close()
